<template>
  <div>
    <a-modal :title="title" :visible="visible" @ok="handleOk" @cancel="handleCancel">
      <p v-if="data && title === '已提交报送'">
        {{ `本次报送总人数${data.totalCount}，成功报送${data.successCount}人，报送失败${data.failCount}人。` }}
      </p>
      <p v-if="data && title === '获取报送结果'">
        {{ `本次报送总人数${data.totalCount}，成功报送${data.successCount}人。`
        }}{{ `本次报送正常人数${data.normalCount}，非正常人数${data.abnormalCount}人。` }}
      </p>
      <p v-if="data">
        {{ data.failList && data.failList.length !== 0 ? `${data.failList[0].empName}等${data.failList.length}人报送失败` : "" }}
      </p>
    </a-modal>
  </div>
</template>
<script>
export default {
  data() {
    return {
      data: null,
      title: "",
      visible: false
    };
  },
  methods: {
    showModal(data, text) {
      console.log(data);
      this.visible = true;
      this.title = text;
      this.data = data.data;
    },
    handleOk(e) {
      this.visible = false;
    },
    handleCancel(e) {
      this.visible = false;
    }
  }
};
</script>
